% This function is simply a wrapper for image_preprocess, adapted from
% svmtest but without SVM
function num_detects = ffdtest(data, varargin)
%% Current features are Area, Eccentricity and MeanIntensity courtesy of regionprops
    path = data.path;
    name = data.file;
    im = imread([path, name]);
    [stats, ~, ~, fg_bd] = image_preprocess(im, path, name, data, varargin); % note that colorvec is now deprecated
    %% If true, outline the items with colour green = positive, orange = negative, and SAVE output
    SVMCLASSOUT = true;
    if(SVMCLASSOUT)
        f = figure('Visible', 'off'); imagesc(im); axis off; hold on;
        for i = 1:length(fg_bd)
            text(floor(max(fg_bd{i}(:,2))) + 5, floor(max(fg_bd{i}(:,1))) + 5, num2str(i), 'FontSize', 5, 'Color', 'r');
            plot(fg_bd{i}(:,2), fg_bd{i}(:,1), 'r', 'LineWidth', 0.5);
        end;
        saveas(f, strcat(path, name, '_result.png'));
    end;
    %% Return score vals
    num_detects = length(stats);
 return;